﻿var lib = fl.getDocumentDOM().library;
lib.selectAll(true);
var selItems = fl.getDocumentDOM().library.getSelectedItems();
var mcLinkName = prompt("输入库元件链接名", "mc link name here");
for(var i=0;i<selItems.length;i++)
{
	if(selItems[i].linkageClassName == mcLinkName)
	{
		fl.trace("find----------" + mcLinkName);
		lib.addItemToDocument({x:200.0, y:200.0}, selItems[i].name); 
		lib.selectItem(selItems[i].name);
		lib.renameItem(mcLinkName);
		
		alert("恭喜！找到了元件链接名为"+mcLinkName+"的元件,放在舞台(200,200)位置");
	}
}